home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11003 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: uni-erlangen.de!winx03!sunshine!schoof
  2. From: schoof@informatik.uni-wuerzburg.de (Jochen Schoof)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Newbie doesn't understand compiler error
  5. Date: 21 Mar 1996 13:35:07 GMT
  6. Organization: University of Wuerzburg, Germany
  7. Message-ID: <4irlub$jtn@winx03.informatik.uni-wuerzburg.de>
  8. References: <Pine.SUN.3.91.960301153010.11258B-100000@pioneer.uspto.gov> <4hoffl$l74@aphex.direct.ca>
  9. NNTP-Posting-Host: wi2x01.informatik.uni-wuerzburg.de
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Ed Toivanen (etoivane@direct.ca) wrote:
  13. :  
  14. : >
  15. : >main( int argv, char *argc[] )  <<- Compiler states "Syntax error at or near
  16. :
  17. : Try 
  18. :  main(int argc, char* argv[])
  19. :
  20. : That should fixn things up.
  21.  
  22. I don't see why. If the program does not compile with the given
  23. definition it most likely won't do so either with your suggestion.
  24. The names of variables can be chosen arbitrarily - even for the
  25. parameters of main(). Using argc as the argument counter and
  26. argv as the pointer to the arguments is sort of convention, but
  27. not required by the standard. Interchanging these two is not the
  28. best idea but however legal C.
  29.  
  30. Most likely the diagnosed error occurs in the next line. Unfortunately 
  31. the original posting is not available at my place, so I can not help 
  32. any further. 
  33.  
  34. - Jochen
  35.  
  36. --
  37. --------------------------------------------------------------------------
  38.  Jochen Schoof                  mailto:schoof@informatik.uni-wuerzburg.de
  39.  Lehrstuhl fuer Informatik II +-------------------------------------------
  40.  Universitaet Wuerzburg       | You are just reading a .sig-light:
  41.  D-97074 Wuerzburg (Germany)  | It is free of fat, sugar and cholesterol!
  42. ------------------------------+-------------------------------------------
  43.  WWW-Homepage:        http://www.informatik.uni-wuerzburg.de/staff/joscho
  44. --------------------------------------------------------------------------
  45.